package com.ruoyi.message.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 消息处理对象 qcl_message
 *
 * @author ruoyi
 * @date 2024-10-25
 */
@TableName(value = "qcl_message")
@Data
public class Message extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 消息ID
     */
    @Excel(name = "消息ID")
    private Long id;

    /**
     * 消息类型
     */
    @Excel(name = "消息类型")
    private String type;

    /**
     * 发送方ID
     */
    @Excel(name = "发送方ID")
    private Long senderId;

    /**
     * 发送方昵称
     */
    @Excel(name = "发送方昵称")
    private String senderNickname;

    /**
     * 接收方ID
     */
    @Excel(name = "接收方ID")
    private Long receiverId;

    /**
     * 接收方昵称
     */
    @Excel(name = "接收方昵称")
    private String receiverNickname;

    /**
     * 消息内容
     */
    @Excel(name = "消息内容")
    private String content;

    /**
     * 发送时间
     */
    @Excel(name = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    /**
     * 1:已读 0:未读
     */
    @Excel(name = "1:已读 0:未读")
    private Long status;

    /**
     * 接收时间
     */
    @Excel(name = "接收时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receveTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("type", getType())
                .append("senderId", getSenderId())
                .append("senderNickname", getSenderNickname())
                .append("receiverId", getReceiverId())
                .append("receiverNickname", getReceiverNickname())
                .append("content", getContent())
                .append("sendTime", getSendTime())
                .append("status", getStatus())
                .append("receveTime", getReceveTime())
                .toString();
    }
}
